from fastapi import FastAPI

from service import dataReadTimeDomainWaveform

app = FastAPI()

url = '/data/read'

@app.get(url + '/timeDomainWaveform')
def read(dataUrl: str):
    print(f"成功接收到Java端地址..{dataUrl}")
    result = dataReadTimeDomainWaveform(dataUrl)
    print(f"解析结果：{result}")
    return result


if __name__ == '__main__':
    PROT = 8080
    import uvicorn
    uvicorn.run(app=app,
                host="0.0.0.0",
                port=PROT,
                workers=1)
    print(f"Python端启动成功....端口号：{PROT}")
